{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2024-05-04T11:38:17.524107500Z",
     "start_time": "2024-05-04T11:38:17.513161200Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "''"
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\"\n",
    "FROM tester:v0.1.0\n",
    "\n",
    "# 设置工作目录\n",
    "WORKDIR /root/GPT-Java-Tester\n",
    "\n",
    "# 将启动脚本添加到镜像中\n",
    "COPY entrypoint.sh /entrypoint.sh\n",
    "\n",
    "# 赋予启动脚本执行权限\n",
    "RUN chmod +x /entrypoint.sh\n",
    "\n",
    "# 设置容器启动时执行的命令\n",
    "ENTRYPOINT [\"sh /entrypoint.sh && /bin/bash\"]\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "\"\"\"\n",
    "#!/bin/bash\n",
    "source /etc/profile\n",
    "echo \"source /etc/profile\"\n",
    "export PYTHONPATH=$PYTHONPATH:~/GPT-Java-Tester\n",
    "echo \"export PYTHONPATH=$PYTHONPATH:~/GPT-Java-Tester\"\n",
    "service postgresql start\n",
    "echo \"service postgresql start\"\n",
    "nohup prefect server start > ~/prefect.log 2>&1 &\n",
    "echo \"nohup prefect server start > ~/prefect.log 2>&1 &\"\n",
    "nohup python ~/GPT-Java-Tester/ui/main.py > ~/uvicorn.log 2>&1 &\n",
    "echo \"nohup python ~/GPT-Java-Tester/ui/main.py > ~/uvicorn.log 2>&1 &\"\n",
    "nohup npm --prefix ~/prefect-ui run serve > ~/prefect-ui.log 2>&1 &\n",
    "echo \"nohup npm --prefix ~/prefect-ui run serve > ~/prefect-ui.log 2>&1 &\"\n",
    "echo \"entrypoint.sh done\"\n",
    "\"\"\""
   ],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
